<?php
 require('../control/mysql.php'); 
 require('../control/checkauth.class.php');
//  防止全局变量造成安全隐患
$admin = false;
//  启动会话，这步必不可少
session_start();
if(!(isset($_SESSION["admin"]))){
  $url = "/libraryoa/view/login.php";
  Header("Location: $url");
}
?>
<html>
<head>
<title>云南大学图书管</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8" />
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/headernav.css">
<script type="text/javascript" src="js/jquery.js" ></script>
<script type="text/javascript" src="js/bootstrap.min.js" ></script>

</head>

<body>
<div id="logo">
<img src="images/icon.png">
<span>图书馆勤工办公系统</span>
</div>
<!--导航-->
<nav class="navbar navbar-default" role="navigation" id="header_nav">

<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
            <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                    </button>
                     
                    </div>

                    <!-- Collect the nav links, forms, and other content for toggling -->
                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav">

                    <li ><a href="main.php">首页</a></li>
        <li class="dropdown"> 
<a href="#考勤管理">考勤管理</a>
              <ul class="dropdown-menu">
                 <?php 	$person=$_SESSION['user'];
						$q=$person->getauth();
						$have=in_array('a4',$q);
						if ($have){?>
     <li><a href="workattend.php">学生考勤</a></li>
     <?php }?>
              </ul>
        </li>
        <li class="dropdown"> 
<a href="#考勤管理">公共通讯录</a>
              <ul class="dropdown-menu">
                 <li><a href="stuinfo.php">学生通讯录</a></li>
     <li><a href="teachinfo.php">老师通讯录</a></li>
              </ul>
        </li>
            <li class="dropdown"> 
  <a href="#">值班管理</a>
              <ul class="dropdown-menu">
                 <li><a href="zhibanbiao.php">值班表</a></li>
                 <?php 	$person=$_SESSION['user'];
						$q=$person->getauth();
						$have=in_array('a1',$q);
						if ($have){?>
        <li><a href="dutymanage.php">排班</a></li>
        <?php }?>
              </ul>
        </li>
         <li class="dropdown"> 
  <a href="#">财务管理</a>
              <ul class="dropdown-menu">
              <?php 	$person=$_SESSION['user'];
						$q=$person->getauth();
						$have=in_array('a5',$q);
						if ($have){?>
                 <li><a href="salarymanage1.php">本科生工资</a></li>
        <li><a href="#salarymanage2.html">研究生工资</a></li>
        <?php }?>
              </ul>
        </li>
   <li class="dropdown"> 
<a href="#考勤管理">报表管理</a>
              <ul class="dropdown-menu">
     <li><a href="workrecord.php">勤工登记表</a></li>
    <li><a href="shangshu.php">上书表</a></li>
    <li><a href="#bengongzuobiao.html">本科生学生工资表</a></li>
    <li><a href="#gongzi1.html">研究生学生工资表</a></li>
              </ul>
        </li>
         <li class="dropdown"> 
  <a href="#">申请管理</a>
              <ul class="dropdown-menu">
			  <?php if($_SESSION['usertype']=='s'){?>
			  <li><a href="quit.php">离职申请</a></li>
			  <?php }?>
              <?php 	$person=$_SESSION['user'];
						$q=$person->getauth();
						$have=in_array('a0',$q);
						if ($have){?>
                 <li><a href="apply_list.php">入职申请</a></li>
		<li><a href="short_quit_info.php">离职申请</a></li>
        <?php }?>
              </ul>
        </li>
  <li class="dropdown"> 
  <a href="#">系统管理</a>
              <ul class="dropdown-menu">
              <?php 	$person=$_SESSION['user'];
						$q=$person->getauth();
						$have=in_array('a3',$q);
						if ($have){?>
                 <li><a href="sysadmin.php">用户管理</a></li>
                 <?php }?>
                 <?php 	$person=$_SESSION['user'];
						$q=$person->getauth();
						$have=in_array('a2',$q);
						if ($have){?>
        <li><a href="dbback.php">数据库备份</a></li>
        <li><a href="db_restore.php">数据库还原</a></li>
        <?php }?>
              </ul>
        </li>
      </ul>

    <ul class="nav navbar-nav navbar-right">

    <li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php if(isset($_SESSION["admin"])){
            echo $_SESSION["admin"];
      } ?>
      <span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
          <li><a href="selfinformation.php">个人信息</a></li>
           <li><a href="passwordchange.php">修改密码</a></li>
          </ul>
          </li>
          <li><a href="login.php">退出</a></li>
          </ul>
          </div><!-- /.navbar-collapse -->
          </div><!-- /.container-fluid -->
          </nav>





